home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / Demos_Files / OLE_Automation / TrainNetworkCode.txt < prev    next >
Encoding:
Text File  |  2002-03-08  |  1.4 KB  |  47 lines

  1. Private Sub cmdTrain_Click()
  2.  
  3.     Dim NSApp As Object
  4.     Dim NSBB As Object
  5.     Dim mseArray As Variant
  6.     Dim finalMSE As Single
  7.     Dim numberOfEpochs As Integer
  8.         
  9.     Set NSApp = CreateObject("NeuroSolutions.Application")
  10.     Set NSBB = NSApp.activeBreadboard
  11.     
  12.     NSApp.maximize
  13.     
  14.     NSBB.send "control. setEpochs ( 500 )"
  15.     numberOfEpochs = txtEpochs.Text      
  16.     NSBB.send "control. setEpochs ( " & numberOfEpochs & " )"
  17.     NSBB.send "dataStorage. setBufferLength ( " & numberOfEpochs & " )"
  18.     NSBB.send "dataStorage. setMessageEvery ( " & numberOfEpochs & " )"
  19.             
  20.     NSBB.Select "hidden1SynapseBackpropGradient", False
  21.     NSBB.Select "hidden1AxonBackpropGradient", True
  22.     NSBB.Select "outputSynapseBackpropGradient", True
  23.     NSBB.Select "outputAxonBackpropGradient", True
  24.     NSBB.send "activeSelection. setStepSize ( " & txtStepSize.Text & " )"
  25.     NSBB.send "activeSelection. setMomentumRate ( 0.800000 )"
  26.     
  27.     NSBB.send "trainingCostProbe. openEngineWindow (  )"
  28.     
  29.     NSBB.Select "Null", False
  30.  
  31.     NSBB.send "control. resetNetwork (  )"
  32.     NSBB.send "control. runNetwork (  )"
  33.     
  34.     mseArray = NSBB.send("dataStorage.getProbeData()")
  35.  
  36.     finalMSE = mseArray(numberOfEpochs - 1, 0)
  37.  
  38.     txtFinalMSE.Text = Format(finalMSE, "0.00000")
  39.     
  40. End Sub
  41.  
  42. Private Sub Label1_Click()
  43.  
  44. End Sub
  45.  
  46.  
  47.